package com.padakeji.android.pworks.module.image.common;

import android.content.Intent;
import android.net.Uri;
import android.provider.MediaStore;
import com.padakeji.android.pworks.content.FileUtils;
import java.io.File;

/**
 * Created by AtanL on 2015/9/19.
 */
public class ImageCaptureHelper {

    private String newImagePath = null;

    public String getCapturedImagePath() {
        return newImagePath;
    }

    public Intent newImageCaptureIntent() {
        File newImageFile = FileUtils.newTempImageFile();
        if (newImageFile == null) {
            return null;
        }
        newImagePath = newImageFile.getPath();
        Intent i = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
        Uri uri = Uri.fromFile(newImageFile);
        i.putExtra(MediaStore.EXTRA_OUTPUT, uri);
        i.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
        return i;
    }

}
